export const gcjGps = (e, t, r) => {
  e = Number(e), t = Number(t);
  var n = 6378245, i = .006693421622965943, a = 3.141592653589793;
  function o(e, t) {
      var r = s(e, t), n = 2 * t - r.lon, i = 2 * e - r.lat, a = {
          lon: n,
          lat: i
      };
      return a;
  }
  function u(e, t) {
      return s(e, t);
  }
  function s(e, t) {
      if (c(e, t)) return {
          lat: e,
          lon: t
      };
      var r = l(t - 105, e - 35), o = d(t - 105, e - 35), u = e / 180 * a, s = Math.sin(u);
      s = 1 - i * s * s;
      var f = Math.sqrt(s);
      r = 180 * r / (n * (1 - i) / (s * f) * a), o = 180 * o / (n / f * Math.cos(u) * a);
      var p = e + r, v = t + o;
      return {
          lat: p,
          lon: v
      };
  }
  function c(e, t) {
      return t < 72.004 || t > 137.8347 || (e < .8293 || e > 55.8271);
  }
  function l(e, t) {
      var r = 2 * e - 100 + 3 * t + .2 * t * t + .1 * e * t + .2 * Math.sqrt(Math.abs(e));
      return r += 2 * (20 * Math.sin(6 * e * a) + 20 * Math.sin(2 * e * a)) / 3, r += 2 * (20 * Math.sin(t * a) + 40 * Math.sin(t / 3 * a)) / 3, 
      r += 2 * (160 * Math.sin(t / 12 * a) + 320 * Math.sin(t * a / 30)) / 3, r;
  }
  function d(e, t) {
      var r = 300 + e + 2 * t + .1 * e * e + .1 * e * t + .1 * Math.sqrt(Math.abs(e));
      return r += 2 * (20 * Math.sin(6 * e * a) + 20 * Math.sin(2 * e * a)) / 3, r += 2 * (20 * Math.sin(e * a) + 40 * Math.sin(e / 3 * a)) / 3, 
      r += 2 * (150 * Math.sin(e / 12 * a) + 300 * Math.sin(e / 30 * a)) / 3, r;
  }
  return r ? o(e, t) : u(e, t);
}
